﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Back-end.Master" AutoEventWireup="true" CodeBehind="QuanLyCauHoi.aspx.cs" Inherits="TracNghiemTinHocDaiCuong.QuanLyCauHoi" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnXoaCauHoi").click(function () {
                if ($("#hdfThongBao").val() != "")
                    return confirm('Bạn có muốn xóa câu hỏi này?');
            });
        });
    </script>
     <div>
        <table border="0" cellspacing="2px" cellpadding="4px" width="100%">
    	    <tr>
    		    <td style="width: 50px">
                <br />
                Đề bài
                <br />
                </td>
                <td style="width: 261px">
                    <br />
                    <asp:TextBox ID="txtNoiDung" runat="Server" CssClass="txt"></asp:TextBox>
                    <br />
                </td>
                <td>
                    <asp:Button ID="btnTimKiem" runat="Server" Text="Tìm kiếm" OnClick="btnTimKiem_Click"/>
                    <br />
                    <asp:Button ID="btnXoaTuKhoa" runat="Server" Text="Xóa từ khóa" OnClick="btnXoaTuKhoa_Click"/>
                </td>
    	    </tr>
        </table>
        <br />
    </div>
    <div>
        <asp:Button ID="btnThemCauHoi" runat="Server" Text="Thêm câu hỏi mới"
                    OnClick="btnThemCauHoi_Click"/>
        <asp:Button ID="btnSuaCauHoi" runat="server"  Text="Sửa" OnClick="btnSuaCauHoi_Click"/>
        <asp:Button ID="btnXoaCauHoi" runat="server" Text="Xóa" OnClick="btnXoaCauHoi_Click"
        ClientIDMode="Static"/>
        <asp:HiddenField ID="hdfThongBao" runat="server" ClientIDMode="Static"/>
    </div>
    
    <div class="gvChuDe">
        <div class="thongBao">
            <asp:Label ID="lblThongBao" runat="server"></asp:Label>
        </div>
        <div>
            <asp:ListView ID="lvCauHoi" runat="server" OnPagePropertiesChanged="ListCauHoi_PropertiesChanged">
                <LayoutTemplate>
                    <div runat="server" id="itemPlaceholder">
                        <div class="deBai" runat="server"></div>
                        <div runat="server"></div>
                        <div runat="server"></div>
                        <div runat="server"></div>
                        <div runat="server"></div>
                    </div>

                </LayoutTemplate>
                <ItemTemplate>
                    <div class="deBai">
                        <asp:LinkButton ID="lkbtnCau" runat="server" Font-Bold="true"
                        CommandName='<%# Eval("MaCH") %>' OnCommand="lkbtnCau_Click"
                        CommandArgument='<%# Container.DataItemIndex + 1 %>'>Câu <%# Container.DataItemIndex + 1 %>:</asp:LinkButton>
                        <asp:Label ID="lblDeBai" runat="server" Text='<%# Eval("NoiDung") %>'></asp:Label>
                    </div>
                    
                    <div class="dapAn">
                        <asp:CheckBox Checked='<%# Eval("DapAn").Equals("A") %>' ID="chkDapAnA" runat="server" Text='<%# Eval("DapAnA") %>'></asp:CheckBox>
                    </div>
                    <div  class="dapAn">
                        <asp:CheckBox Checked='<%# Eval("DapAn").Equals("B") %>' ID="chkDapAnB" runat="server" Text='<%# Eval("DapAnB") %>'></asp:CheckBox>
                    </div>
                    <div  class="dapAn">
                        <asp:CheckBox Checked='<%# Eval("DapAn").Equals("C") %>' ID="chkDapAnC" runat="server" Text='<%# Eval("DapAnC") %>'></asp:CheckBox>
                    </div>
                    <div  class="dapAn">
                        <asp:CheckBox Checked='<%# Eval("DapAn").Equals("D") %>' ID="chkDapAnD" runat="server" Text='<%# Eval("DapAnD") %>'></asp:CheckBox>
                    </div>
                    <br />
                </ItemTemplate>
            </asp:ListView>
                <asp:DataPager runat="server" ID="dp" PageSize="10" OnPreRender="PagerCauHoi_PreRender"
                PagedControlID="lvCauHoi"
                QueryStringField="Page">
                  <Fields>
                    <asp:NumericPagerField ButtonCount="10" 
                         CurrentPageLabelCssClass="CurrentPage"
                         NumericButtonCssClass="PageNumbers"
                         NextPreviousButtonCssClass="PageNumbers" NextPageText=" > "
                         PreviousPageText=" < " />
                  </Fields>
                </asp:DataPager>        </div>
    </div>
</asp:Content>
